<cfscript>    
    view = createObject("component", session.rootDir & ".views.layout");
    if( Session.Auth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) ){
        view.init("Finance Creation Report",
            "",
            "","Home",main);
    }else{
        view.init("Denied","","","Home","Denied");
    }    
    view.html();
</cfscript>

<cffunction name="main" access="public" output="true" returntype="any">
    <cfscript>
        import models.*;
        KronosQueries = CreateObject("component", session.rootDir & ".DatabaseQueries.Kronos");
        StepActions = ORMExecuteQuery("FROM StepActions WHERE StepsID = 6 AND ActTimeStamp IS NULL AND TermReqID IS NULL");
    </cfscript>
    <script language="javascript">
        window.print();
    </script>
    <h1 class="title">Finance Creation Report</h1>
    <div class="entry">
            
        <table width=100%>
            <tr> 
                <td valign="bottom"><u>##</u></td> 
                <td valign="bottom"><strong><u>Name</u></strong></td>
                <td valign="bottom"><strong><u>Job Title</u></strong></td>
                <td valign="bottom"><strong><u>Department</u></strong></td>
                <td valign="bottom"><strong><u>Badge No.</u></strong></td>
            </tr>
            
            <cfloop from="1" to="#ArrayLen(StepActions)#" index="i">
                <cfset Employee = ORMExecuteQuery("FROM Employee WHERE EmployeeID = " & StepActions[i].getEmployeeID() & " AND NonSCFTypeID IS NULL") />
                <cfif ArrayLen(Employee) NEQ 0>
                    <cfset PositionInfo = KronosQueries.funcGetPositionInfo(Employee[1].getPositionID()) />
                    <cfset Depts = KronosQueries.funcGetDepts(Employee[1].getDepartmentID()) />
                    <cfset Rosetta = ORMExecuteQuery("FROM RosettaStone WHERE RosettaID = " & Employee[1].getRosettaID()) />
                    <tr> 
                        <td>#i#)</td>  
                        <td valign="bottom">#Employee[1].getFirstName()# #Employee[1].getLastName()#</td>
                        <td valign="bottom">#PositionInfo.PositionCodeDescription#</td>
                        <td valign="bottom">#Depts.OrganizationDescription#</td>
                        <td valign="bottom">#Employee[1].getBadgeID()#</td>
                    </tr>
                </cfif>
            </cfloop>
            
        </table>            

    </div>        

</cffunction>